package te2rpt

class ShipActualResultController {

    def commonDataService
    def dynamicQueryService
    def index(Integer max) {
        def cellList = org.kdx.DataUtils.getCellList()
        def pageSizeList = org.kdx.DataUtils.getPageSizeList()

        [totalCount: 5, pageSize: 20, pageCurrent: 1, orderField: 'id', orderDirection: 'asc', pageSizeList: pageSizeList, cellList: cellList]
    }
    def shipActualResult(){
        def pageCurrent = params.pageCurrent ? Integer.parseInt(params.pageCurrent) : 1
        def pageSize = params.pageSize ? Integer.parseInt(params.pageSize) : 100
        params.startno = (pageSize * (pageCurrent - 1)) + 1
        params.endno = pageSize * pageCurrent
        def pageSizeList = [10,20,50,100]
        print(params)
        params.SYS_QUERY_NAME = 'shipActualResult'
        def shipActualResult = dynamicQueryService.queryForList(params)
        def tableHeadList =  []
        if(shipActualResult.size()>0){
            tableHeadList =  shipActualResult[0].keySet()
        }
        params.SYS_QUERY_NAME = 'shipActualResultCount'
        def totalCount = dynamicQueryService.queryForList(params)[0].TOTALCOUNT
        //��ѯ����
        params.SYS_QUERY_NAME = 'shipActualResultPart'
        def shipActualResultPart = dynamicQueryService.queryForList(params)



        [tableHeadList:tableHeadList, pageSizeList:pageSizeList,pageSize:pageSize,totalCount:totalCount, startno:params.startno?:'',endno:params.endno?:'',
         shipActualResult:shipActualResult,shipActualResultPart:shipActualResultPart,
         startTime:params.startTime?:'',endTime:params.endTime?:'',partDesc:params.partDesc?:'',docId:params.docId?:'']
    }
}
